package net.srcz.jsjvm.core;

public class DescriptorUtil {

	public static int getStackSize(String descriptor) {
		String[] vals = descriptor.split(";");
		int nb = 0;
		for(String val : vals) {
			if(val.contains("()"))
				continue;
			if(val.indexOf(')') != -1)
				val = val.substring(0,val.indexOf(')'));
			if(val.length() == 0)
				continue;
		//System.err.println(val);
			nb++;
		}
		return nb;
	}
}
